package hv.fmw.core.configure {
	import hv.fmw.core.command.Command;
	import hv.fmw.core.command.ICommand;
	import hv.fmw.utils.Config;
	import hv.lib.text.FontLoader;
	import hv.lib.text.Text;

	import flash.events.Event;
	import flash.net.URLRequest;

	/**
	 * @author hvong
	 */
	public class ConfigureFontsCmd extends Command implements ICommand {
		public function ConfigureFontsCmd() {
			super();
		}

		public function execute() : void {
			var loader:FontLoader = new FontLoader();
				loader.addEventListener(Event.COMPLETE, _onCommandComplete);
				loader.load(new URLRequest(Config.getPath("fonts")));
		}

		private function _onCommandComplete(event : Event) : void {
			Text.traceAvailableFonts();
			super.complete();
		}
	}
}
